#ifndef STACK_QUEUE
#define STACK_QUEUE

#define MAX_SIZE 1024

typedef struct sq_stack{
    int data[MAX_SIZE];
    int top;    
}sq_stack;
void sqs_init(sq_stack *stack);
int sqs_push(sq_stack *stack, int data);
int sqs_pop(sq_stack *stack, int *data);

typedef struct lsnode{
    int data;
    struct lsnode *next;
}lsnode,*lslist;
int ls_init(lslist *list);
int ls_push(lslist *list, int data);
int ls_pop(lslist *list, int *data);

typedef struct sq_queue{
    int data[MAX_SIZE];
    int front;
    int rear;
}sq_queue;
int sqq_length(sq_queue *queue);
int sqq_out(sq_queue *queue, int *data);
int sqq_in(sq_queue *queue, int data);
int sqq_init(sq_queue *queue);
int sqq_length(sq_queue *queue);

typedef struct lqnode{
    int data;
    struct lqnode *next;
}lqnode;

typedef struct lqueue{
    lqnode *front;
    lqnode *rear;
}lqueue,*lqlist;
int lq_length(lqlist *list);
int lq_destroy(lqlist *list);
int lq_out(lqlist *list, int *data);
int lq_in(lqlist *list, int data);
int lq_init(lqlist *list);

#endif